<html>
  <head>
    <title>Fenix Web Servers</title>
    <!-- build:css ../css/core.css -->
    <link rel="stylesheet" href="../css/main.css"/>
    <link rel="stylesheet" href="../css/animate.min.css"/>
    <link rel="stylesheet" href="../css/hint.min.css"/>
    <!-- endbuild -->
    <style>
      BODY {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 12px;
        background: #131313 url('../icons/fenix.png');
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: -10px 20px;
        background-size: 120px;
      }

      BODY > div {
        border-top: 6px solid rgba(197,59,46,.8);
        border-radius: 2px;
        display: block;
        position: absolute;
        top: 0;
        right: 24;
        bottom: 24;
        left: 0;
      }

      BODY > div > div {
        position: absolute;
        left: 105px;
        right: 30px;
        top: 5px;
        bottom: 30px;
        color: #fff;
        display: block;
        font-size: 12px;
      }

      a {
        color: gold;
        text-decoration: none;
        font-weight: bold;
      }

      #contrib {
        display: none;
      }
      .show {
        display: block !important;
      }

      #close {
        position: fixed;
        right: 10px;
        top: 0;
        font-size: 30px;
        font-weight: 100;
        color: #393939;
        z-index: 5000;
      }

      hr {
        border: 0;
        border-top: 1px solid #232323;
        border-bottom: 1px solid #000;
        margin: 8px 0 8px 0;
      }

      a.simple {
        font-weight: 100;
        color: #f7faeb;
        border-bottom: 1px dotted #f7faeb;
      }
    </style>
  </head>
  <body class="hasservers">
    <div>
      <div>
        <h1 id="name" style="margin: 0;">Fenix</h1>
        Author: <span id="author"></span><br/>
        <div id="contrib">Contributors: <span id="contributors"></span><br/></div>
        <br/> <a href="javascript:open('http://fenixwebserver.com');">Fenixwebserver.com</a>
        <hr/>
        <a href="javascript:open('http://fenixwebserver.com/help');">Documentation | </a>
        <a href="javascript:open('http://github.com/coreybutler/fenix/issues');">Submit an Issue | Suggestion</a>
        <hr/>
        <div style="background-color: #212121;border:1px solid #000;padding:4px;border-radius:2px;font-size:14px;"><b>Like Fenix?</b> Donate at <a href="javascript:open('http://gittip.com/coreybutler/');">gittip.com</a>.</div>
        <p>Fenix is licensed under the GPL license, available at http://www.gnu.org/licenses/gpl-2.0.html. Notices, terms and
        conditions pertaining to third party software are located at http://github.com/coreybutler/fenix and incorporated by reference herein.</p>
        <p><a href="javascript:open('http://fenixwebserver.com/#register');" class="simple">Register</a> to receive updates, follow the project on <a href="javascript:open('http://github.com/coreybutler/fenix');" class="simple">GitHub</a> or the author on <a href="javascript:open('http://twitter.com/goldglovecb');" class="simple">Twitter</a>.</p>
        <p>Copyright &copy; 2014 Ecor Ventures, LLC and its licensors. All rights reserved.</p>
      </div>
    </div>
    <a href="javascript:closeme();" id="close">&times;</a>
    <script type="text/javascript">
      var gui = require('nw.gui');

      function open(url){
        gui.Shell.openExternal(url);
      };

      function closeme(){
        gui.Window.get(this).hide();
      }

      function getContribs(){
        return (require('./package.json').contributors||[]).map(function(person){
          return person.name;
        }).join(', ');
      };

      var pkg = require('./package.json');
      document.getElementById('name').innerHTML = document.getElementById('name').innerHTML+' '+pkg.version;
      document.getElementById('author').innerHTML = '<a class="simple" href="javascript:open(\''+pkg.author.url+'\');">'+pkg.author.name+'</a>';
      document.getElementById('contributors').innerHTML = getContribs();
      if (document.getElementById('contributors').innerHTML.trim().length > 0){
        document.getElementById('contrib').classList.add('show');
      }
    </script>
  </body>
</html>
